package com.g1.gzbooksingle.mapper;

import com.g1.gzbooksingle.model.DgBookInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* <p>
    * 图书信息表 Mapper 接口
    * </p>
*
* @author admin
* @since 2021-10-12
*/
@Mapper
public interface DgBookInfoMapper extends BaseMapper<DgBookInfo> {

    //查询全部图书
    @Select("select * from dg_book_info")
    List<DgBookInfo> selectAll();

    /**
     * 按分类id查询图书
     * @param indexIds 所有分类id的字符串
     * @return
     */
    @Select("SELECT id,book_name,author_id,publish_id,descption,price,image_path,index_id,discount_price,is_sign FROM dg_book_info WHERE index_id in ${indexIds}")
    List<DgBookInfo> selectByIndexId(String indexIds);


}
